﻿namespace HRM.CORE
{
    using DevExpress.Utils;
    using DevExpress.XtraEditors;
    using DevExpress.XtraEditors.Controls;
    using DevExpress.XtraGrid.Columns;
    using DevExpress.XtraGrid.Views.Grid;
    using DevExpress.XtraTab;
    using Microsoft.VisualBasic;
    using APP.HELPER;
    using Common.Base;
    using Common.Class; using APP.HELPER.Utils.Language; using Security.Security; using Dictionary.ERP;
    using HRM.CORE;
    using HRM.CORE.CLASS;
    
    
    
    using System; using Extra.ERP;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms; using Common;
    using Common;
    using Security.ERP;

    public class xucContractAdd : Common.xucBaseAddH
    {
        private CalcEdit calBasicSalary;
        private CalcEdit calCompensation;
        private ComboBoxEdit cboContractTime;
        private ComboBoxEdit cboContractType;
        private ComboBoxEdit cboPayForm;
        private CheckEdit chxIsCurrent;
        private GridColumn colEmployeeCode;
        private GridColumn colFirstName;
        private GridColumn colLastName;
        private IContainer components = null;
        private DateEdit dtFromDate;
        private DateEdit dtIDCardDate;
        private DateEdit dtSignDate;
        private DateEdit dtToDate;
        private GridLookUpEdit glkEmployeeCode;
        private GridLookUpEdit glkSignerCode;
        private GroupBox grContractInformation;
        private GridColumn gridColumn1;
        private GridColumn gridColumn2;
        private GridColumn gridColumn3;
        private GridColumn gridColumn4;
        private GridColumn gridColumn5;
        private GridColumn gridColumn6;
        private GridColumn gridColumn7;
        private GridColumn gridColumn8;
        private GridColumn gridColumn9;
        private GridView gridLookUpEdit2View;
        private GridView gridView1;
        private GroupBox grSideA;
        private GroupBox grSideB;
        private GroupBox grTerms;
        private LabelControl labelControl1;
        private LabelControl labelControl2;
        private LabelControl lcAddress;
        private LabelControl lcAllowance;
        private LabelControl lcBasicSalary;
        private LabelControl lcCompany;
        private LabelControl lcContractCode;
        private LabelControl lcContractName;
        private LabelControl lcContractTime;
        private LabelControl lcContractType;
        private LabelControl lcDepartment;
        private LabelControl lcDescription;
        private LabelControl lcEmployeeCode;
        private LabelControl lcFromDate;
        private LabelControl lcIDCard;
        private LabelControl lcIDCardDate;
        private LabelControl lcIDCardPlace;
        private LabelControl lcInsurance;
        private LabelControl lcPayDate;
        private LabelControl lcPayForm;
        private LabelControl lcPosition;
        private LabelControl lcSignDate;
        private LabelControl lcSigner;
        private LabelControl lcSignerPosition;
        private LabelControl lcSubject;
        private LabelControl lcTel;
        private LabelControl lcToDate;
        private LabelControl lcWorkTime;
        private string m_ContractCode = "";
        private XtraTabPage tabContractInformation;
        private XtraTabPage tabSides;
        private TextEdit txtAddress;
        private TextEdit txtAllowance;
        private TextEdit txtCompany;
        private TextEdit txtContractCode;
        private TextEdit txtContractName;
        private TextEdit txtCreatePlace;
        private TextEdit txtDepartment;
        private MemoEdit txtDescription;
        private TextEdit txtEmployeeName;
        private TextEdit txtIDCard;
        private TextEdit txtIDCardPlace;
        private TextEdit txtInsurance;
        private TextEdit txtNationality1;
        private TextEdit txtPayDate;
        private TextEdit txtPosition;
        private TextEdit txtSigner;
        private TextEdit txtSignerNationality;
        private TextEdit txtSignerPosition;
        private TextEdit txtSubject;
        private TextEdit txtTel;
        private TextEdit txtWorkTime;
        private xucDateEdit xdeBirthday;
        private XtraTabControl xtraTabControl1;

        public event SuccessEventHander Success;

        public xucContractAdd()
        {
            this.InitializeComponent();
            this.InitMultiLanguages();
            this.InitData();
        }

        protected override void Add()
        {
            base.Add();
            this.txtContractCode.Text = new HRM_CONTRACT().NewID();
        }

        private void cboContractTime_EditValueChanged(object sender, EventArgs e)
        {
            if (this.cboContractTime.SelectedIndex == 0)
            {
                this.dtToDate.DateTime = DateAndTime.DateAdd(DateInterval.Month, 2.0, this.dtFromDate.DateTime);
            }
            else if (this.cboContractTime.SelectedIndex == 1)
            {
                this.dtToDate.DateTime = DateAndTime.DateAdd(DateInterval.Month, 3.0, this.dtFromDate.DateTime);
            }
            else if (this.cboContractTime.SelectedIndex == 2)
            {
                this.dtToDate.DateTime = DateAndTime.DateAdd(DateInterval.Month, 6.0, this.dtFromDate.DateTime);
            }
            else if (this.cboContractTime.SelectedIndex == 3)
            {
                this.dtToDate.DateTime = DateAndTime.DateAdd(DateInterval.Month, 9.0, this.dtFromDate.DateTime);
            }
            else if (this.cboContractTime.SelectedIndex == 4)
            {
                this.dtToDate.DateTime = DateAndTime.DateAdd(DateInterval.Year, 1.0, this.dtFromDate.DateTime);
            }
            else if (this.cboContractTime.SelectedIndex == 5)
            {
                this.dtToDate.DateTime = DateAndTime.DateAdd(DateInterval.Year, 2.0, this.dtFromDate.DateTime);
            }
            else if (this.cboContractTime.SelectedIndex == 6)
            {
                this.dtToDate.DateTime = DateAndTime.DateAdd(DateInterval.Year, 3.0, this.dtFromDate.DateTime);
            }
        }

        private void cboContractType_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.cboContractType.SelectedIndex == 1)
            {
                this.lcContractTime.Visible = false;
                this.cboContractTime.Visible = false;
                this.lcToDate.Visible = false;
                this.dtToDate.Visible = false;
            }
            else
            {
                this.lcContractTime.Visible = true;
                this.cboContractTime.Visible = true;
                this.lcToDate.Visible = true;
                this.dtToDate.Visible = true;
            }
        }

        public void Clear()
        {
            this.txtDescription.Text = "[Ghi ch\x00fa]";
            this.xtraTabControl1.SelectedTabPage = this.tabSides;
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void gbList_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
        {
            if (e.RowHandle == -2147483648)
            {
                e.Handled = true;
                e.Painter.DrawObject(e.Info);
                Rectangle bounds = e.Bounds;
                e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(0x3f, 0xa5, 0xa5, 0)), bounds);
                bounds.Height--;
                bounds.Width--;
                e.Graphics.DrawRectangle(Pens.Blue, bounds);
            }
            int rowHandle = e.RowHandle;
            if (rowHandle >= 0)
            {
                rowHandle++;
                e.Info.DisplayText = rowHandle.ToString();
            }
        }

        private void glkEmployeeCode_EditValueChanged(object sender, EventArgs e)
        {
            HRM_EMPLOYEE hrm_employee = new HRM_EMPLOYEE();
            hrm_employee.Get(this.glkEmployeeCode.EditValue.ToString());
            this.txtEmployeeName.Text = hrm_employee.FirstName + " " + hrm_employee.LastName;
            this.xdeBirthday.Day = hrm_employee.BirthdayDay;
            this.xdeBirthday.Month = hrm_employee.BirthdayMonth;
            this.xdeBirthday.Year = hrm_employee.BirthdayYear;
            this.txtPosition.Text = hrm_employee.Position;
            this.txtNationality1.Text = hrm_employee.Nationality;
            this.txtIDCard.Text = hrm_employee.IDCard;
            this.dtIDCardDate.DateTime = hrm_employee.IDCardDate;
            this.txtIDCardPlace.Text = hrm_employee.IDCardPlace;
            HRM_BRANCH hrm_branch = new HRM_BRANCH();
            hrm_branch.Get(hrm_employee.BranchCode);
            HRM_DEPARTMENT hrm_department = new HRM_DEPARTMENT();
            hrm_department.Get(hrm_employee.DepartmentCode);
            this.txtDepartment.Text = hrm_branch.BranchName + " - " + hrm_department.DepartmentName;
            this.calBasicSalary.EditValue = hrm_employee.BasicSalary;
            HRM_EMPLOYEE_ALLOWANCE hrm_employee_allowance = new HRM_EMPLOYEE_ALLOWANCE();
            foreach (DataRow row in hrm_employee_allowance.GetList(hrm_employee.EmployeeCode).Rows)
            {
                this.txtAllowance.Text = this.txtAllowance.Text + row["AllowanceName"].ToString() + "; ";
            }
            if (this.glkEmployeeCode.ErrorText != string.Empty)
            {
                base.Err.SetError(this.glkEmployeeCode, string.Empty);
            }
        }

        private void glkSignerCode_EditValueChanged(object sender, EventArgs e)
        {
            HRM_EMPLOYEE hrm_employee = new HRM_EMPLOYEE();
            hrm_employee.Get(this.glkSignerCode.EditValue.ToString());
            this.txtSigner.Text = hrm_employee.FirstName + " " + hrm_employee.LastName;
            this.txtSignerPosition.Text = hrm_employee.Position;
            this.txtSignerNationality.Text = hrm_employee.Nationality;
        }

        private void grSideB_Enter(object sender, EventArgs e)
        {
        }

        protected override void Init()
        {
            base.Init();
        }

        private HRM_CONTRACT InitClass()
        {
            HRM_CONTRACT hrm_contract = new HRM_CONTRACT 
            {
                ContractCode = this.txtContractCode.Text
            };
            if (this.glkEmployeeCode.EditValue != null)
            {
                hrm_contract.EmployeeCode = this.glkEmployeeCode.EditValue.ToString();
            }
            else
            {
                XtraMessageBox.Show("Vui l\x00f2ng chọn nh\x00e2n vi\x00ean cần tạo hợp đồng!");
                return null;
            }
            if (this.txtContractCode.Text == "")
            {
                XtraMessageBox.Show("Vui l\x00f2ng nhập m\x00e3 hợp đồng!");
                return null;
            }
            hrm_contract.ContractType = this.cboContractType.SelectedIndex;
            hrm_contract.ContractTime = this.cboContractTime.Text;
            hrm_contract.SignDate = this.dtSignDate.DateTime;
            hrm_contract.FromDate = this.dtFromDate.DateTime;
            hrm_contract.ToDate = this.dtToDate.DateTime;
            hrm_contract.BasicSalary = decimal.Parse(this.calBasicSalary.EditValue.ToString());
            hrm_contract.PayForm = this.cboPayForm.Text;
            hrm_contract.PayDate = this.txtPayDate.Text;
            hrm_contract.Allowance = this.txtAllowance.Text;
            hrm_contract.Insurance = this.txtInsurance.Text;
            hrm_contract.WorkTime = this.txtWorkTime.Text;
            hrm_contract.Compensation = decimal.Parse(this.calCompensation.EditValue.ToString());
            hrm_contract.Signer = this.txtSigner.Text;
            hrm_contract.SignerPosition = this.txtSignerPosition.Text;
            hrm_contract.SignerNationality = this.txtSignerNationality.Text;
            hrm_contract.Company = this.txtCompany.Text;
            hrm_contract.Address = this.txtAddress.Text;
            hrm_contract.Tel = this.txtTel.Text;
            hrm_contract.CreatePlace = this.txtCreatePlace.Text;
            hrm_contract.Subject = this.txtSubject.Text;
            hrm_contract.Description = this.txtDescription.Text;
            if (this.chxIsCurrent.Checked)
            {
                hrm_contract.IsCurrent = true;
            }
            else
            {
                hrm_contract.IsCurrent = false;
            }
            return hrm_contract;
        }

        private void InitData()
        {
            this.dtSignDate.DateTime = System.DateTime.Now;
            this.dtFromDate.DateTime = System.DateTime.Now;
            this.dtToDate.DateTime = System.DateTime.Now;
            this.dtSignDate.DateTime = System.DateTime.Now;
            HRM_EMPLOYEE hrm_employee = new HRM_EMPLOYEE();
            hrm_employee.AddGridLookupEdit(this.glkEmployeeCode);
            hrm_employee.AddGridLookupEdit(this.glkSignerCode);
            clsContractOption option = new clsContractOption();
            this.txtSigner.Text = option.Signer;
            this.txtSignerNationality.Text = option.SignerNationality;
            this.txtSignerPosition.Text = option.SignerPosition;
            //if (MyInfo.Get(MyEncryption.Encrypt("ERP01", "123654", true)) == "OK")
            {
                this.txtCompany.Text = "";//MyInfo.Company.ToUpper();
                this.txtAddress.Text = "";//MyInfo.Address;
                this.txtTel.Text = ""; //MyInfo.Tel;
                this.txtCreatePlace.Text = "";// MyInfo.Address;
            }
            DIC_SHIFT dic_shift = new DIC_SHIFT();
            foreach (DataRow row in dic_shift.GetList().Rows)
            {
                this.txtWorkTime.Text = this.txtWorkTime.Text + row["ShiftName"].ToString() + " - " + row["ShiftCode"].ToString() + " (" + System.DateTime.Parse(row["BeginTime"].ToString()).ToShortTimeString() + "->" + System.DateTime.Parse(row["EndTime"].ToString()).ToShortTimeString() + "); ";
            }
            DIC_SALARY_FORMULA dic_salary_formula = new DIC_SALARY_FORMULA();
            dic_salary_formula.Get();
            string[] strArray = new string[] { (dic_salary_formula.SocialInsurance1 * 100.0).ToString(), " % BHXH, ", (dic_salary_formula.HealthInsurance1 * 100.0).ToString(), " % BHYT, ", (dic_salary_formula.UnemploymentInsurance1 * 100.0).ToString(), " % BHTN" };
            this.txtInsurance.Text = string.Concat(strArray);
        }

        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(xucContractAdd));
            this.gridColumn1 = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridColumn2 = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridColumn3 = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridColumn4 = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridColumn5 = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridColumn6 = new DevExpress.XtraGrid.Columns.GridColumn();
            this.chxIsCurrent = new DevExpress.XtraEditors.CheckEdit();
            this.xtraTabControl1 = new DevExpress.XtraTab.XtraTabControl();
            this.tabSides = new DevExpress.XtraTab.XtraTabPage();
            this.grSideB = new System.Windows.Forms.GroupBox();
            this.xdeBirthday = new Common.Base.xucDateEdit();
            this.lcIDCardPlace = new DevExpress.XtraEditors.LabelControl();
            this.lcIDCardDate = new DevExpress.XtraEditors.LabelControl();
            this.lcIDCard = new DevExpress.XtraEditors.LabelControl();
            this.txtIDCardPlace = new DevExpress.XtraEditors.TextEdit();
            this.dtIDCardDate = new DevExpress.XtraEditors.DateEdit();
            this.txtIDCard = new DevExpress.XtraEditors.TextEdit();
            this.txtNationality1 = new DevExpress.XtraEditors.TextEdit();
            this.glkEmployeeCode = new DevExpress.XtraEditors.GridLookUpEdit();
            this.gridLookUpEdit2View = new DevExpress.XtraGrid.Views.Grid.GridView();
            this.colEmployeeCode = new DevExpress.XtraGrid.Columns.GridColumn();
            this.colFirstName = new DevExpress.XtraGrid.Columns.GridColumn();
            this.colLastName = new DevExpress.XtraGrid.Columns.GridColumn();
            this.lcEmployeeCode = new DevExpress.XtraEditors.LabelControl();
            this.txtEmployeeName = new DevExpress.XtraEditors.TextEdit();
            this.lcPosition = new DevExpress.XtraEditors.LabelControl();
            this.txtPosition = new DevExpress.XtraEditors.TextEdit();
            this.txtDepartment = new DevExpress.XtraEditors.TextEdit();
            this.lcDepartment = new DevExpress.XtraEditors.LabelControl();
            this.grSideA = new System.Windows.Forms.GroupBox();
            this.lcTel = new DevExpress.XtraEditors.LabelControl();
            this.txtTel = new DevExpress.XtraEditors.TextEdit();
            this.lcAddress = new DevExpress.XtraEditors.LabelControl();
            this.txtAddress = new DevExpress.XtraEditors.TextEdit();
            this.lcCompany = new DevExpress.XtraEditors.LabelControl();
            this.txtCompany = new DevExpress.XtraEditors.TextEdit();
            this.txtSignerNationality = new DevExpress.XtraEditors.TextEdit();
            this.lcSignerPosition = new DevExpress.XtraEditors.LabelControl();
            this.txtSignerPosition = new DevExpress.XtraEditors.TextEdit();
            this.lcSigner = new DevExpress.XtraEditors.LabelControl();
            this.glkSignerCode = new DevExpress.XtraEditors.GridLookUpEdit();
            this.gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView();
            this.gridColumn7 = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridColumn8 = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridColumn9 = new DevExpress.XtraGrid.Columns.GridColumn();
            this.txtSigner = new DevExpress.XtraEditors.TextEdit();
            this.tabContractInformation = new DevExpress.XtraTab.XtraTabPage();
            this.labelControl2 = new DevExpress.XtraEditors.LabelControl();
            this.txtCreatePlace = new DevExpress.XtraEditors.TextEdit();
            this.grTerms = new System.Windows.Forms.GroupBox();
            this.calCompensation = new DevExpress.XtraEditors.CalcEdit();
            this.labelControl1 = new DevExpress.XtraEditors.LabelControl();
            this.lcWorkTime = new DevExpress.XtraEditors.LabelControl();
            this.txtWorkTime = new DevExpress.XtraEditors.TextEdit();
            this.txtPayDate = new DevExpress.XtraEditors.TextEdit();
            this.lcPayDate = new DevExpress.XtraEditors.LabelControl();
            this.txtInsurance = new DevExpress.XtraEditors.TextEdit();
            this.lcInsurance = new DevExpress.XtraEditors.LabelControl();
            this.cboPayForm = new DevExpress.XtraEditors.ComboBoxEdit();
            this.lcPayForm = new DevExpress.XtraEditors.LabelControl();
            this.calBasicSalary = new DevExpress.XtraEditors.CalcEdit();
            this.txtAllowance = new DevExpress.XtraEditors.TextEdit();
            this.lcBasicSalary = new DevExpress.XtraEditors.LabelControl();
            this.lcAllowance = new DevExpress.XtraEditors.LabelControl();
            this.lcContractName = new DevExpress.XtraEditors.LabelControl();
            this.txtContractName = new DevExpress.XtraEditors.TextEdit();
            this.lcContractCode = new DevExpress.XtraEditors.LabelControl();
            this.txtContractCode = new DevExpress.XtraEditors.TextEdit();
            this.lcSubject = new DevExpress.XtraEditors.LabelControl();
            this.lcDescription = new DevExpress.XtraEditors.LabelControl();
            this.txtDescription = new DevExpress.XtraEditors.MemoEdit();
            this.grContractInformation = new System.Windows.Forms.GroupBox();
            this.lcContractType = new DevExpress.XtraEditors.LabelControl();
            this.cboContractType = new DevExpress.XtraEditors.ComboBoxEdit();
            this.lcContractTime = new DevExpress.XtraEditors.LabelControl();
            this.cboContractTime = new DevExpress.XtraEditors.ComboBoxEdit();
            this.dtFromDate = new DevExpress.XtraEditors.DateEdit();
            this.lcFromDate = new DevExpress.XtraEditors.LabelControl();
            this.dtToDate = new DevExpress.XtraEditors.DateEdit();
            this.lcToDate = new DevExpress.XtraEditors.LabelControl();
            this.dtSignDate = new DevExpress.XtraEditors.DateEdit();
            this.lcSignDate = new DevExpress.XtraEditors.LabelControl();
            this.txtSubject = new DevExpress.XtraEditors.TextEdit();
            ((System.ComponentModel.ISupportInitialize)(this.Err)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.imageCollection2)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.chxIsCurrent.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.xtraTabControl1)).BeginInit();
            this.xtraTabControl1.SuspendLayout();
            this.tabSides.SuspendLayout();
            this.grSideB.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.txtIDCardPlace.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.dtIDCardDate.Properties.CalendarTimeProperties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.dtIDCardDate.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtIDCard.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtNationality1.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.glkEmployeeCode.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.gridLookUpEdit2View)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtEmployeeName.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtPosition.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtDepartment.Properties)).BeginInit();
            this.grSideA.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.txtTel.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtAddress.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtCompany.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtSignerNationality.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtSignerPosition.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.glkSignerCode.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.gridView1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtSigner.Properties)).BeginInit();
            this.tabContractInformation.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.txtCreatePlace.Properties)).BeginInit();
            this.grTerms.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.calCompensation.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtWorkTime.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtPayDate.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtInsurance.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.cboPayForm.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.calBasicSalary.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtAllowance.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtContractName.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtContractCode.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtDescription.Properties)).BeginInit();
            this.grContractInformation.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.cboContractType.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.cboContractTime.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.dtFromDate.Properties.CalendarTimeProperties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.dtFromDate.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.dtToDate.Properties.CalendarTimeProperties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.dtToDate.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.dtSignDate.Properties.CalendarTimeProperties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.dtSignDate.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtSubject.Properties)).BeginInit();
            this.SuspendLayout();
            // 
            // btnCancel
            // 
            this.btnCancel.Location = new System.Drawing.Point(472, 409);
            this.btnCancel.TabIndex = 4;
            // 
            // btnSave
            // 
            this.btnSave.Location = new System.Drawing.Point(266, 409);
            this.btnSave.TabIndex = 2;
            // 
            // btnSaveNew
            // 
            this.btnSaveNew.Location = new System.Drawing.Point(368, 409);
            this.btnSaveNew.TabIndex = 3;
            // 
            // imageCollection2
            // 
            this.imageCollection2.ImageStream = ((DevExpress.Utils.ImageCollectionStreamer)(resources.GetObject("imageCollection2.ImageStream")));
            // 
            // gridColumn1
            // 
            this.gridColumn1.Caption = "Mã";
            this.gridColumn1.FieldName = "EmployeeCode";
            this.gridColumn1.Name = "gridColumn1";
            this.gridColumn1.Visible = true;
            this.gridColumn1.VisibleIndex = 0;
            this.gridColumn1.Width = 60;
            // 
            // gridColumn2
            // 
            this.gridColumn2.Caption = "Họ Lót";
            this.gridColumn2.FieldName = "FirstName";
            this.gridColumn2.Name = "gridColumn2";
            this.gridColumn2.Visible = true;
            this.gridColumn2.VisibleIndex = 1;
            this.gridColumn2.Width = 113;
            // 
            // gridColumn3
            // 
            this.gridColumn3.Caption = "Tên";
            this.gridColumn3.FieldName = "LastName";
            this.gridColumn3.Name = "gridColumn3";
            this.gridColumn3.Visible = true;
            this.gridColumn3.VisibleIndex = 2;
            this.gridColumn3.Width = 80;
            // 
            // gridColumn4
            // 
            this.gridColumn4.Caption = "Mã";
            this.gridColumn4.FieldName = "EmployeeCode";
            this.gridColumn4.Name = "gridColumn4";
            this.gridColumn4.Visible = true;
            this.gridColumn4.VisibleIndex = 0;
            // 
            // gridColumn5
            // 
            this.gridColumn5.Caption = "Họ Lót";
            this.gridColumn5.FieldName = "FirstName";
            this.gridColumn5.Name = "gridColumn5";
            this.gridColumn5.Visible = true;
            this.gridColumn5.VisibleIndex = 1;
            // 
            // gridColumn6
            // 
            this.gridColumn6.Caption = "Tên";
            this.gridColumn6.FieldName = "LastName";
            this.gridColumn6.Name = "gridColumn6";
            this.gridColumn6.Visible = true;
            this.gridColumn6.VisibleIndex = 2;
            // 
            // chxIsCurrent
            // 
            this.chxIsCurrent.EditValue = true;
            this.chxIsCurrent.Location = new System.Drawing.Point(12, 409);
            this.chxIsCurrent.Name = "chxIsCurrent";
            this.chxIsCurrent.Properties.Caption = "Là hợp đồng hiện tại";
            this.chxIsCurrent.Size = new System.Drawing.Size(140, 19);
            this.chxIsCurrent.TabIndex = 1;
            this.chxIsCurrent.Visible = false;
            // 
            // xtraTabControl1
            // 
            this.xtraTabControl1.Dock = System.Windows.Forms.DockStyle.Top;
            this.xtraTabControl1.Location = new System.Drawing.Point(2, 2);
            this.xtraTabControl1.Name = "xtraTabControl1";
            this.xtraTabControl1.SelectedTabPage = this.tabSides;
            this.xtraTabControl1.Size = new System.Drawing.Size(579, 398);
            this.xtraTabControl1.TabIndex = 0;
            this.xtraTabControl1.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[] {
            this.tabSides,
            this.tabContractInformation});
            // 
            // tabSides
            // 
            this.tabSides.Controls.Add(this.grSideB);
            this.tabSides.Controls.Add(this.grSideA);
            this.tabSides.Name = "tabSides";
            this.tabSides.Size = new System.Drawing.Size(573, 370);
            this.tabSides.Text = "Các Bên Tham Gia";
            // 
            // grSideB
            // 
            this.grSideB.Controls.Add(this.xdeBirthday);
            this.grSideB.Controls.Add(this.lcIDCardPlace);
            this.grSideB.Controls.Add(this.lcIDCardDate);
            this.grSideB.Controls.Add(this.lcIDCard);
            this.grSideB.Controls.Add(this.txtIDCardPlace);
            this.grSideB.Controls.Add(this.dtIDCardDate);
            this.grSideB.Controls.Add(this.txtIDCard);
            this.grSideB.Controls.Add(this.txtNationality1);
            this.grSideB.Controls.Add(this.glkEmployeeCode);
            this.grSideB.Controls.Add(this.lcEmployeeCode);
            this.grSideB.Controls.Add(this.txtEmployeeName);
            this.grSideB.Controls.Add(this.lcPosition);
            this.grSideB.Controls.Add(this.txtPosition);
            this.grSideB.Controls.Add(this.txtDepartment);
            this.grSideB.Controls.Add(this.lcDepartment);
            this.grSideB.Location = new System.Drawing.Point(10, 191);
            this.grSideB.Name = "grSideB";
            this.grSideB.Size = new System.Drawing.Size(555, 138);
            this.grSideB.TabIndex = 1;
            this.grSideB.TabStop = false;
            this.grSideB.Text = "Bên B";
            this.grSideB.Enter += new System.EventHandler(this.grSideB_Enter);
            // 
            // xdeBirthday
            // 
            this.xdeBirthday.Day = 1;
            this.xdeBirthday.Location = new System.Drawing.Point(358, 20);
            this.xdeBirthday.Month = 1;
            this.xdeBirthday.Name = "xdeBirthday";
            this.xdeBirthday.ReadOnly = true;
            this.xdeBirthday.Size = new System.Drawing.Size(180, 20);
            this.xdeBirthday.TabIndex = 24;
            this.xdeBirthday.Year = 2013;
            // 
            // lcIDCardPlace
            // 
            this.lcIDCardPlace.Location = new System.Drawing.Point(354, 106);
            this.lcIDCardPlace.Name = "lcIDCardPlace";
            this.lcIDCardPlace.Size = new System.Drawing.Size(16, 13);
            this.lcIDCardPlace.TabIndex = 13;
            this.lcIDCardPlace.Text = "tại:";
            // 
            // lcIDCardDate
            // 
            this.lcIDCardDate.Location = new System.Drawing.Point(207, 106);
            this.lcIDCardDate.Name = "lcIDCardDate";
            this.lcIDCardDate.Size = new System.Drawing.Size(49, 13);
            this.lcIDCardDate.TabIndex = 11;
            this.lcIDCardDate.Text = "Ngày cấp:";
            // 
            // lcIDCard
            // 
            this.lcIDCard.Location = new System.Drawing.Point(9, 106);
            this.lcIDCard.Name = "lcIDCard";
            this.lcIDCard.Size = new System.Drawing.Size(48, 13);
            this.lcIDCard.TabIndex = 9;
            this.lcIDCard.Text = "Số CMND:";
            // 
            // txtIDCardPlace
            // 
            this.txtIDCardPlace.Location = new System.Drawing.Point(377, 103);
            this.txtIDCardPlace.Name = "txtIDCardPlace";
            this.txtIDCardPlace.Properties.ReadOnly = true;
            this.txtIDCardPlace.Size = new System.Drawing.Size(161, 20);
            this.txtIDCardPlace.TabIndex = 14;
            // 
            // dtIDCardDate
            // 
            this.dtIDCardDate.EditValue = null;
            this.dtIDCardDate.Location = new System.Drawing.Point(258, 103);
            this.dtIDCardDate.Name = "dtIDCardDate";
            this.dtIDCardDate.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
            this.dtIDCardDate.Properties.CalendarTimeProperties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
            new DevExpress.XtraEditors.Controls.EditorButton()});
            this.dtIDCardDate.Properties.ReadOnly = true;
            this.dtIDCardDate.Size = new System.Drawing.Size(86, 20);
            this.dtIDCardDate.TabIndex = 12;
            // 
            // txtIDCard
            // 
            this.txtIDCard.Location = new System.Drawing.Point(85, 103);
            this.txtIDCard.Name = "txtIDCard";
            this.txtIDCard.Properties.ReadOnly = true;
            this.txtIDCard.Size = new System.Drawing.Size(116, 20);
            this.txtIDCard.TabIndex = 10;
            // 
            // txtNationality1
            // 
            this.txtNationality1.EditValue = "[Quốc tịch]";
            this.txtNationality1.Location = new System.Drawing.Point(324, 48);
            this.txtNationality1.Name = "txtNationality1";
            this.txtNationality1.Properties.NullText = "[Họ và tên của người ký]";
            this.txtNationality1.Properties.ReadOnly = true;
            this.txtNationality1.Size = new System.Drawing.Size(214, 20);
            this.txtNationality1.TabIndex = 6;
            // 
            // glkEmployeeCode
            // 
            this.glkEmployeeCode.Location = new System.Drawing.Point(86, 20);
            this.glkEmployeeCode.Name = "glkEmployeeCode";
            this.glkEmployeeCode.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
            this.glkEmployeeCode.Properties.NullText = "[Chọn]";
            this.glkEmployeeCode.Properties.View = this.gridLookUpEdit2View;
            this.glkEmployeeCode.Size = new System.Drawing.Size(99, 20);
            this.glkEmployeeCode.TabIndex = 1;
            this.glkEmployeeCode.EditValueChanged += new System.EventHandler(this.glkEmployeeCode_EditValueChanged);
            // 
            // gridLookUpEdit2View
            // 
            this.gridLookUpEdit2View.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
            this.colEmployeeCode,
            this.colFirstName,
            this.colLastName});
            this.gridLookUpEdit2View.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus;
            this.gridLookUpEdit2View.Name = "gridLookUpEdit2View";
            this.gridLookUpEdit2View.OptionsSelection.EnableAppearanceFocusedCell = false;
            this.gridLookUpEdit2View.OptionsView.ShowAutoFilterRow = true;
            this.gridLookUpEdit2View.OptionsView.ShowGroupPanel = false;
            // 
            // colEmployeeCode
            // 
            this.colEmployeeCode.Caption = "Mã";
            this.colEmployeeCode.FieldName = "EmployeeCode";
            this.colEmployeeCode.Name = "colEmployeeCode";
            this.colEmployeeCode.Visible = true;
            this.colEmployeeCode.VisibleIndex = 0;
            // 
            // colFirstName
            // 
            this.colFirstName.Caption = "Họ Lót";
            this.colFirstName.FieldName = "FirstName";
            this.colFirstName.Name = "colFirstName";
            this.colFirstName.Visible = true;
            this.colFirstName.VisibleIndex = 1;
            // 
            // colLastName
            // 
            this.colLastName.Caption = "Tên";
            this.colLastName.FieldName = "LastName";
            this.colLastName.Name = "colLastName";
            this.colLastName.Visible = true;
            this.colLastName.VisibleIndex = 2;
            // 
            // lcEmployeeCode
            // 
            this.lcEmployeeCode.Location = new System.Drawing.Point(8, 23);
            this.lcEmployeeCode.Name = "lcEmployeeCode";
            this.lcEmployeeCode.Size = new System.Drawing.Size(68, 13);
            this.lcEmployeeCode.TabIndex = 0;
            this.lcEmployeeCode.Text = "Mã nhân viên:";
            // 
            // txtEmployeeName
            // 
            this.txtEmployeeName.Location = new System.Drawing.Point(188, 20);
            this.txtEmployeeName.Name = "txtEmployeeName";
            this.txtEmployeeName.Properties.Appearance.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
            this.txtEmployeeName.Properties.Appearance.Options.UseFont = true;
            this.txtEmployeeName.Properties.NullText = "[Họ tên]";
            this.txtEmployeeName.Properties.ReadOnly = true;
            this.txtEmployeeName.Size = new System.Drawing.Size(164, 20);
            this.txtEmployeeName.TabIndex = 2;
            // 
            // lcPosition
            // 
            this.lcPosition.Location = new System.Drawing.Point(8, 51);
            this.lcPosition.Name = "lcPosition";
            this.lcPosition.Size = new System.Drawing.Size(56, 13);
            this.lcPosition.TabIndex = 4;
            this.lcPosition.Text = "Chức danh:";
            // 
            // txtPosition
            // 
            this.txtPosition.EditValue = "[Chức danh hiện tại]";
            this.txtPosition.Location = new System.Drawing.Point(85, 48);
            this.txtPosition.Name = "txtPosition";
            this.txtPosition.Properties.Appearance.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
            this.txtPosition.Properties.Appearance.Options.UseFont = true;
            this.txtPosition.Properties.ReadOnly = true;
            this.txtPosition.Size = new System.Drawing.Size(233, 20);
            this.txtPosition.TabIndex = 5;
            // 
            // txtDepartment
            // 
            this.txtDepartment.EditValue = "[Nơi đang làm việc]";
            this.txtDepartment.Location = new System.Drawing.Point(85, 75);
            this.txtDepartment.Name = "txtDepartment";
            this.txtDepartment.Properties.ReadOnly = true;
            this.txtDepartment.Size = new System.Drawing.Size(453, 20);
            this.txtDepartment.TabIndex = 8;
            // 
            // lcDepartment
            // 
            this.lcDepartment.Location = new System.Drawing.Point(8, 78);
            this.lcDepartment.Name = "lcDepartment";
            this.lcDepartment.Size = new System.Drawing.Size(60, 13);
            this.lcDepartment.TabIndex = 7;
            this.lcDepartment.Text = "Làm việc tại:";
            // 
            // grSideA
            // 
            this.grSideA.Controls.Add(this.lcTel);
            this.grSideA.Controls.Add(this.txtTel);
            this.grSideA.Controls.Add(this.lcAddress);
            this.grSideA.Controls.Add(this.txtAddress);
            this.grSideA.Controls.Add(this.lcCompany);
            this.grSideA.Controls.Add(this.txtCompany);
            this.grSideA.Controls.Add(this.txtSignerNationality);
            this.grSideA.Controls.Add(this.lcSignerPosition);
            this.grSideA.Controls.Add(this.txtSignerPosition);
            this.grSideA.Controls.Add(this.lcSigner);
            this.grSideA.Controls.Add(this.glkSignerCode);
            this.grSideA.Controls.Add(this.txtSigner);
            this.grSideA.Location = new System.Drawing.Point(10, 15);
            this.grSideA.Name = "grSideA";
            this.grSideA.Size = new System.Drawing.Size(553, 159);
            this.grSideA.TabIndex = 0;
            this.grSideA.TabStop = false;
            this.grSideA.Text = "Bên A";
            // 
            // lcTel
            // 
            this.lcTel.Location = new System.Drawing.Point(11, 127);
            this.lcTel.Name = "lcTel";
            this.lcTel.Size = new System.Drawing.Size(53, 13);
            this.lcTel.TabIndex = 10;
            this.lcTel.Text = "Điện thoại:";
            // 
            // txtTel
            // 
            this.txtTel.EditValue = "[Điện thoại]";
            this.txtTel.Location = new System.Drawing.Point(85, 124);
            this.txtTel.Name = "txtTel";
            this.txtTel.Properties.ReadOnly = true;
            this.txtTel.Size = new System.Drawing.Size(453, 20);
            this.txtTel.TabIndex = 11;
            // 
            // lcAddress
            // 
            this.lcAddress.Location = new System.Drawing.Point(11, 101);
            this.lcAddress.Name = "lcAddress";
            this.lcAddress.Size = new System.Drawing.Size(36, 13);
            this.lcAddress.TabIndex = 8;
            this.lcAddress.Text = "Địa chỉ:";
            // 
            // txtAddress
            // 
            this.txtAddress.EditValue = "[Địa chỉ công ty]";
            this.txtAddress.Location = new System.Drawing.Point(86, 98);
            this.txtAddress.Name = "txtAddress";
            this.txtAddress.Properties.ReadOnly = true;
            this.txtAddress.Size = new System.Drawing.Size(452, 20);
            this.txtAddress.TabIndex = 9;
            // 
            // lcCompany
            // 
            this.lcCompany.Location = new System.Drawing.Point(11, 75);
            this.lcCompany.Name = "lcCompany";
            this.lcCompany.Size = new System.Drawing.Size(63, 13);
            this.lcCompany.TabIndex = 6;
            this.lcCompany.Text = "Đại diện cho:";
            // 
            // txtCompany
            // 
            this.txtCompany.EditValue = "[Tên công ty]";
            this.txtCompany.Location = new System.Drawing.Point(86, 72);
            this.txtCompany.Name = "txtCompany";
            this.txtCompany.Properties.Appearance.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
            this.txtCompany.Properties.Appearance.Options.UseFont = true;
            this.txtCompany.Properties.ReadOnly = true;
            this.txtCompany.Size = new System.Drawing.Size(452, 20);
            this.txtCompany.TabIndex = 7;
            // 
            // txtSignerNationality
            // 
            this.txtSignerNationality.EditValue = "[Quốc tịch]";
            this.txtSignerNationality.Location = new System.Drawing.Point(340, 20);
            this.txtSignerNationality.Name = "txtSignerNationality";
            this.txtSignerNationality.Properties.NullText = "[Họ và tên của người ký]";
            this.txtSignerNationality.Properties.ReadOnly = true;
            this.txtSignerNationality.Size = new System.Drawing.Size(198, 20);
            this.txtSignerNationality.TabIndex = 3;
            // 
            // lcSignerPosition
            // 
            this.lcSignerPosition.Location = new System.Drawing.Point(11, 49);
            this.lcSignerPosition.Name = "lcSignerPosition";
            this.lcSignerPosition.Size = new System.Drawing.Size(44, 13);
            this.lcSignerPosition.TabIndex = 4;
            this.lcSignerPosition.Text = "Chức vụ:";
            // 
            // txtSignerPosition
            // 
            this.txtSignerPosition.EditValue = "[Chức danh người ký]";
            this.txtSignerPosition.Location = new System.Drawing.Point(85, 46);
            this.txtSignerPosition.Name = "txtSignerPosition";
            this.txtSignerPosition.Properties.Appearance.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
            this.txtSignerPosition.Properties.Appearance.Options.UseFont = true;
            this.txtSignerPosition.Properties.ReadOnly = true;
            this.txtSignerPosition.Size = new System.Drawing.Size(453, 20);
            this.txtSignerPosition.TabIndex = 5;
            // 
            // lcSigner
            // 
            this.lcSigner.Location = new System.Drawing.Point(11, 21);
            this.lcSigner.Name = "lcSigner";
            this.lcSigner.Size = new System.Drawing.Size(73, 13);
            this.lcSigner.TabIndex = 0;
            this.lcSigner.Text = "Đại diện CT ký:";
            // 
            // glkSignerCode
            // 
            this.glkSignerCode.Location = new System.Drawing.Point(86, 20);
            this.glkSignerCode.Name = "glkSignerCode";
            this.glkSignerCode.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
            this.glkSignerCode.Properties.NullText = "[Chọn]";
            this.glkSignerCode.Properties.View = this.gridView1;
            this.glkSignerCode.Size = new System.Drawing.Size(99, 20);
            this.glkSignerCode.TabIndex = 1;
            this.glkSignerCode.EditValueChanged += new System.EventHandler(this.glkSignerCode_EditValueChanged);
            // 
            // gridView1
            // 
            this.gridView1.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
            this.gridColumn7,
            this.gridColumn8,
            this.gridColumn9});
            this.gridView1.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus;
            this.gridView1.Name = "gridView1";
            this.gridView1.OptionsSelection.EnableAppearanceFocusedCell = false;
            this.gridView1.OptionsView.ShowAutoFilterRow = true;
            this.gridView1.OptionsView.ShowGroupPanel = false;
            // 
            // gridColumn7
            // 
            this.gridColumn7.Caption = "Mã";
            this.gridColumn7.FieldName = "EmployeeCode";
            this.gridColumn7.Name = "gridColumn7";
            this.gridColumn7.Visible = true;
            this.gridColumn7.VisibleIndex = 0;
            // 
            // gridColumn8
            // 
            this.gridColumn8.Caption = "Họ Lót";
            this.gridColumn8.FieldName = "FirstName";
            this.gridColumn8.Name = "gridColumn8";
            this.gridColumn8.Visible = true;
            this.gridColumn8.VisibleIndex = 1;
            // 
            // gridColumn9
            // 
            this.gridColumn9.Caption = "Tên";
            this.gridColumn9.FieldName = "LastName";
            this.gridColumn9.Name = "gridColumn9";
            this.gridColumn9.Visible = true;
            this.gridColumn9.VisibleIndex = 2;
            // 
            // txtSigner
            // 
            this.txtSigner.Location = new System.Drawing.Point(188, 20);
            this.txtSigner.Name = "txtSigner";
            this.txtSigner.Properties.Appearance.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
            this.txtSigner.Properties.Appearance.Options.UseFont = true;
            this.txtSigner.Properties.NullText = "[Họ và tên của người ký]";
            this.txtSigner.Properties.ReadOnly = true;
            this.txtSigner.Size = new System.Drawing.Size(146, 20);
            this.txtSigner.TabIndex = 2;
            // 
            // tabContractInformation
            // 
            this.tabContractInformation.Controls.Add(this.labelControl2);
            this.tabContractInformation.Controls.Add(this.txtCreatePlace);
            this.tabContractInformation.Controls.Add(this.grTerms);
            this.tabContractInformation.Controls.Add(this.lcContractName);
            this.tabContractInformation.Controls.Add(this.txtContractName);
            this.tabContractInformation.Controls.Add(this.lcContractCode);
            this.tabContractInformation.Controls.Add(this.txtContractCode);
            this.tabContractInformation.Controls.Add(this.lcSubject);
            this.tabContractInformation.Controls.Add(this.lcDescription);
            this.tabContractInformation.Controls.Add(this.txtDescription);
            this.tabContractInformation.Controls.Add(this.grContractInformation);
            this.tabContractInformation.Controls.Add(this.txtSubject);
            this.tabContractInformation.Name = "tabContractInformation";
            this.tabContractInformation.Size = new System.Drawing.Size(573, 370);
            this.tabContractInformation.Text = "Thông Tin Hợp Đồng";
            // 
            // labelControl2
            // 
            this.labelControl2.Appearance.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap;
            this.labelControl2.AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.None;
            this.labelControl2.Location = new System.Drawing.Point(10, 265);
            this.labelControl2.Name = "labelControl2";
            this.labelControl2.Size = new System.Drawing.Size(75, 32);
            this.labelControl2.TabIndex = 6;
            this.labelControl2.Text = "Hợp đồng làm tại:";
            // 
            // txtCreatePlace
            // 
            this.txtCreatePlace.Location = new System.Drawing.Point(91, 270);
            this.txtCreatePlace.Name = "txtCreatePlace";
            this.txtCreatePlace.Size = new System.Drawing.Size(473, 20);
            this.txtCreatePlace.TabIndex = 7;
            // 
            // grTerms
            // 
            this.grTerms.Controls.Add(this.calCompensation);
            this.grTerms.Controls.Add(this.labelControl1);
            this.grTerms.Controls.Add(this.lcWorkTime);
            this.grTerms.Controls.Add(this.txtWorkTime);
            this.grTerms.Controls.Add(this.txtPayDate);
            this.grTerms.Controls.Add(this.lcPayDate);
            this.grTerms.Controls.Add(this.txtInsurance);
            this.grTerms.Controls.Add(this.lcInsurance);
            this.grTerms.Controls.Add(this.cboPayForm);
            this.grTerms.Controls.Add(this.lcPayForm);
            this.grTerms.Controls.Add(this.calBasicSalary);
            this.grTerms.Controls.Add(this.txtAllowance);
            this.grTerms.Controls.Add(this.lcBasicSalary);
            this.grTerms.Controls.Add(this.lcAllowance);
            this.grTerms.Location = new System.Drawing.Point(5, 120);
            this.grTerms.Name = "grTerms";
            this.grTerms.Size = new System.Drawing.Size(560, 141);
            this.grTerms.TabIndex = 5;
            this.grTerms.TabStop = false;
            this.grTerms.Text = "Một số điều khoản";
            // 
            // calCompensation
            // 
            this.calCompensation.EditValue = new decimal(new int[] {
            0,
            0,
            0,
            0});
            this.calCompensation.Location = new System.Drawing.Point(463, 108);
            this.calCompensation.Name = "calCompensation";
            this.calCompensation.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
            this.calCompensation.Properties.Mask.UseMaskAsDisplayFormat = true;
            this.calCompensation.Size = new System.Drawing.Size(85, 20);
            this.calCompensation.TabIndex = 13;
            // 
            // labelControl1
            // 
            this.labelControl1.Appearance.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap;
            this.labelControl1.Location = new System.Drawing.Point(356, 110);
            this.labelControl1.Name = "labelControl1";
            this.labelControl1.Size = new System.Drawing.Size(104, 13);
            this.labelControl1.TabIndex = 12;
            this.labelControl1.Text = "Bồi thường hợp đồng:";
            // 
            // lcWorkTime
            // 
            this.lcWorkTime.Appearance.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap;
            this.lcWorkTime.AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.None;
            this.lcWorkTime.Location = new System.Drawing.Point(10, 104);
            this.lcWorkTime.Name = "lcWorkTime";
            this.lcWorkTime.Size = new System.Drawing.Size(66, 30);
            this.lcWorkTime.TabIndex = 10;
            this.lcWorkTime.Text = "Thời gian làm việc:";
            // 
            // txtWorkTime
            // 
            this.txtWorkTime.EditValue = "";
            this.txtWorkTime.Location = new System.Drawing.Point(86, 108);
            this.txtWorkTime.Name = "txtWorkTime";
            this.txtWorkTime.Size = new System.Drawing.Size(263, 20);
            this.txtWorkTime.TabIndex = 11;
            // 
            // txtPayDate
            // 
            this.txtPayDate.EditValue = "10";
            this.txtPayDate.Location = new System.Drawing.Point(483, 21);
            this.txtPayDate.Name = "txtPayDate";
            this.txtPayDate.Size = new System.Drawing.Size(66, 20);
            this.txtPayDate.TabIndex = 5;
            // 
            // lcPayDate
            // 
            this.lcPayDate.Appearance.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap;
            this.lcPayDate.Location = new System.Drawing.Point(431, 23);
            this.lcPayDate.Name = "lcPayDate";
            this.lcPayDate.Size = new System.Drawing.Size(49, 13);
            this.lcPayDate.TabIndex = 4;
            this.lcPayDate.Text = "Vào ngày:";
            // 
            // txtInsurance
            // 
            this.txtInsurance.EditValue = "";
            this.txtInsurance.Location = new System.Drawing.Point(85, 80);
            this.txtInsurance.Name = "txtInsurance";
            this.txtInsurance.Size = new System.Drawing.Size(463, 20);
            this.txtInsurance.TabIndex = 9;
            // 
            // lcInsurance
            // 
            this.lcInsurance.Location = new System.Drawing.Point(10, 83);
            this.lcInsurance.Name = "lcInsurance";
            this.lcInsurance.Size = new System.Drawing.Size(47, 13);
            this.lcInsurance.TabIndex = 8;
            this.lcInsurance.Text = "Bảo hiểm:";
            // 
            // cboPayForm
            // 
            this.cboPayForm.EditValue = "Trả bằng tiền mặt";
            this.cboPayForm.Location = new System.Drawing.Point(260, 20);
            this.cboPayForm.Name = "cboPayForm";
            this.cboPayForm.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
            this.cboPayForm.Properties.Items.AddRange(new object[] {
            "Trả bằng tiền mặt"});
            this.cboPayForm.Size = new System.Drawing.Size(166, 20);
            this.cboPayForm.TabIndex = 3;
            // 
            // lcPayForm
            // 
            this.lcPayForm.Appearance.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap;
            this.lcPayForm.AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.None;
            this.lcPayForm.Location = new System.Drawing.Point(207, 13);
            this.lcPayForm.Name = "lcPayForm";
            this.lcPayForm.Size = new System.Drawing.Size(54, 30);
            this.lcPayForm.TabIndex = 2;
            this.lcPayForm.Text = "Hình thức trả lương:";
            // 
            // calBasicSalary
            // 
            this.calBasicSalary.EditValue = new decimal(new int[] {
            0,
            0,
            0,
            0});
            this.calBasicSalary.Location = new System.Drawing.Point(85, 20);
            this.calBasicSalary.Name = "calBasicSalary";
            this.calBasicSalary.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
            this.calBasicSalary.Properties.Mask.UseMaskAsDisplayFormat = true;
            this.calBasicSalary.Size = new System.Drawing.Size(111, 20);
            this.calBasicSalary.TabIndex = 1;
            // 
            // txtAllowance
            // 
            this.txtAllowance.EditValue = "";
            this.txtAllowance.Location = new System.Drawing.Point(85, 50);
            this.txtAllowance.Name = "txtAllowance";
            this.txtAllowance.Size = new System.Drawing.Size(463, 20);
            this.txtAllowance.TabIndex = 7;
            // 
            // lcBasicSalary
            // 
            this.lcBasicSalary.Appearance.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap;
            this.lcBasicSalary.AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.None;
            this.lcBasicSalary.Location = new System.Drawing.Point(9, 18);
            this.lcBasicSalary.Name = "lcBasicSalary";
            this.lcBasicSalary.Size = new System.Drawing.Size(66, 30);
            this.lcBasicSalary.TabIndex = 0;
            this.lcBasicSalary.Text = "Mức lương cơ bản:";
            // 
            // lcAllowance
            // 
            this.lcAllowance.Location = new System.Drawing.Point(10, 53);
            this.lcAllowance.Name = "lcAllowance";
            this.lcAllowance.Size = new System.Drawing.Size(42, 13);
            this.lcAllowance.TabIndex = 6;
            this.lcAllowance.Text = "Phụ cấp:";
            // 
            // lcContractName
            // 
            this.lcContractName.Location = new System.Drawing.Point(208, 13);
            this.lcContractName.Name = "lcContractName";
            this.lcContractName.Size = new System.Drawing.Size(70, 13);
            this.lcContractName.TabIndex = 2;
            this.lcContractName.Text = "Tên hợp đồng:";
            // 
            // txtContractName
            // 
            this.txtContractName.EditValue = "Hợp Đồng Lao Động";
            this.txtContractName.Location = new System.Drawing.Point(284, 11);
            this.txtContractName.Name = "txtContractName";
            this.txtContractName.Properties.ReadOnly = true;
            this.txtContractName.Size = new System.Drawing.Size(279, 20);
            this.txtContractName.TabIndex = 3;
            // 
            // lcContractCode
            // 
            this.lcContractCode.Location = new System.Drawing.Point(12, 12);
            this.lcContractCode.Name = "lcContractCode";
            this.lcContractCode.Size = new System.Drawing.Size(66, 13);
            this.lcContractCode.TabIndex = 0;
            this.lcContractCode.Text = "Mã hợp đồng:";
            // 
            // txtContractCode
            // 
            this.txtContractCode.Location = new System.Drawing.Point(90, 10);
            this.txtContractCode.Name = "txtContractCode";
            this.txtContractCode.Size = new System.Drawing.Size(111, 20);
            this.txtContractCode.TabIndex = 1;
            // 
            // lcSubject
            // 
            this.lcSubject.Location = new System.Drawing.Point(9, 299);
            this.lcSubject.Name = "lcSubject";
            this.lcSubject.Size = new System.Drawing.Size(48, 13);
            this.lcSubject.TabIndex = 8;
            this.lcSubject.Text = "Trích yếu:";
            // 
            // lcDescription
            // 
            this.lcDescription.Location = new System.Drawing.Point(12, 327);
            this.lcDescription.Name = "lcDescription";
            this.lcDescription.Size = new System.Drawing.Size(39, 13);
            this.lcDescription.TabIndex = 10;
            this.lcDescription.Text = "Ghi chú:";
            // 
            // txtDescription
            // 
            this.txtDescription.EditValue = "[Ghi chú]";
            this.txtDescription.Location = new System.Drawing.Point(90, 326);
            this.txtDescription.Name = "txtDescription";
            this.txtDescription.Size = new System.Drawing.Size(473, 36);
            this.txtDescription.TabIndex = 11;
            // 
            // grContractInformation
            // 
            this.grContractInformation.Controls.Add(this.lcContractType);
            this.grContractInformation.Controls.Add(this.cboContractType);
            this.grContractInformation.Controls.Add(this.lcContractTime);
            this.grContractInformation.Controls.Add(this.cboContractTime);
            this.grContractInformation.Controls.Add(this.dtFromDate);
            this.grContractInformation.Controls.Add(this.lcFromDate);
            this.grContractInformation.Controls.Add(this.dtToDate);
            this.grContractInformation.Controls.Add(this.lcToDate);
            this.grContractInformation.Controls.Add(this.dtSignDate);
            this.grContractInformation.Controls.Add(this.lcSignDate);
            this.grContractInformation.Location = new System.Drawing.Point(5, 36);
            this.grContractInformation.Name = "grContractInformation";
            this.grContractInformation.Size = new System.Drawing.Size(560, 80);
            this.grContractInformation.TabIndex = 4;
            this.grContractInformation.TabStop = false;
            this.grContractInformation.Text = "Thông tin hợp đồng";
            // 
            // lcContractType
            // 
            this.lcContractType.Location = new System.Drawing.Point(12, 25);
            this.lcContractType.Name = "lcContractType";
            this.lcContractType.Size = new System.Drawing.Size(71, 13);
            this.lcContractType.TabIndex = 0;
            this.lcContractType.Text = "Loại hợp đồng:";
            // 
            // cboContractType
            // 
            this.cboContractType.EditValue = "Hợp đồng xác định thời hạn";
            this.cboContractType.Location = new System.Drawing.Point(86, 22);
            this.cboContractType.Name = "cboContractType";
            this.cboContractType.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
            this.cboContractType.Properties.Items.AddRange(new object[] {
            "Hợp đồng xác định thời hạn",
            "Hợp đồng không xác định thời hạn",
            "Hợp đồng thử việc",
            "Hợp đồng học việc"});
            this.cboContractType.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;
            this.cboContractType.Size = new System.Drawing.Size(236, 20);
            this.cboContractType.TabIndex = 1;
            this.cboContractType.SelectedIndexChanged += new System.EventHandler(this.cboContractType_SelectedIndexChanged);
            // 
            // lcContractTime
            // 
            this.lcContractTime.Location = new System.Drawing.Point(333, 25);
            this.lcContractTime.Name = "lcContractTime";
            this.lcContractTime.Size = new System.Drawing.Size(93, 13);
            this.lcContractTime.TabIndex = 2;
            this.lcContractTime.Text = "Thời hạn hợp đồng:";
            // 
            // cboContractTime
            // 
            this.cboContractTime.EditValue = "0 Tháng";
            this.cboContractTime.Location = new System.Drawing.Point(432, 22);
            this.cboContractTime.Name = "cboContractTime";
            this.cboContractTime.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
            this.cboContractTime.Properties.Items.AddRange(new object[] {
            "2 Tháng",
            "3 Tháng",
            "6 Tháng",
            "9 Tháng",
            "1 Năm",
            "2 Năm",
            "3 Năm",
            "Không Xác Định Thời Hạn"});
            this.cboContractTime.Size = new System.Drawing.Size(117, 20);
            this.cboContractTime.TabIndex = 3;
            this.cboContractTime.EditValueChanged += new System.EventHandler(this.cboContractTime_EditValueChanged);
            // 
            // dtFromDate
            // 
            this.dtFromDate.EditValue = null;
            this.dtFromDate.Location = new System.Drawing.Point(265, 51);
            this.dtFromDate.Name = "dtFromDate";
            this.dtFromDate.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
            this.dtFromDate.Properties.CalendarTimeProperties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
            new DevExpress.XtraEditors.Controls.EditorButton()});
            this.dtFromDate.Size = new System.Drawing.Size(92, 20);
            this.dtFromDate.TabIndex = 7;
            // 
            // lcFromDate
            // 
            this.lcFromDate.Location = new System.Drawing.Point(177, 54);
            this.lcFromDate.Name = "lcFromDate";
            this.lcFromDate.Size = new System.Drawing.Size(83, 13);
            this.lcFromDate.TabIndex = 6;
            this.lcFromDate.Text = "Ngày có hiệu lực:";
            // 
            // dtToDate
            // 
            this.dtToDate.EditValue = null;
            this.dtToDate.Location = new System.Drawing.Point(457, 51);
            this.dtToDate.Name = "dtToDate";
            this.dtToDate.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
            this.dtToDate.Properties.CalendarTimeProperties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
            new DevExpress.XtraEditors.Controls.EditorButton()});
            this.dtToDate.Size = new System.Drawing.Size(92, 20);
            this.dtToDate.TabIndex = 9;
            // 
            // lcToDate
            // 
            this.lcToDate.Location = new System.Drawing.Point(365, 54);
            this.lcToDate.Name = "lcToDate";
            this.lcToDate.Size = new System.Drawing.Size(88, 13);
            this.lcToDate.TabIndex = 8;
            this.lcToDate.Text = "Ngày hết hiệu lực:";
            // 
            // dtSignDate
            // 
            this.dtSignDate.EditValue = null;
            this.dtSignDate.Location = new System.Drawing.Point(74, 51);
            this.dtSignDate.Name = "dtSignDate";
            this.dtSignDate.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
            this.dtSignDate.Properties.CalendarTimeProperties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
            new DevExpress.XtraEditors.Controls.EditorButton()});
            this.dtSignDate.Size = new System.Drawing.Size(92, 20);
            this.dtSignDate.TabIndex = 5;
            // 
            // lcSignDate
            // 
            this.lcSignDate.Location = new System.Drawing.Point(13, 53);
            this.lcSignDate.Name = "lcSignDate";
            this.lcSignDate.Size = new System.Drawing.Size(43, 13);
            this.lcSignDate.TabIndex = 4;
            this.lcSignDate.Text = "Ngày ký:";
            // 
            // txtSubject
            // 
            this.txtSubject.Location = new System.Drawing.Point(90, 299);
            this.txtSubject.Name = "txtSubject";
            this.txtSubject.Size = new System.Drawing.Size(473, 20);
            this.txtSubject.TabIndex = 9;
            // 
            // xucContractAdd
            // 
            this.Controls.Add(this.xtraTabControl1);
            this.Controls.Add(this.chxIsCurrent);
            this.Name = "xucContractAdd";
            this.Padding = new System.Windows.Forms.Padding(2, 2, 0, 0);
            this.Size = new System.Drawing.Size(581, 445);
            this.Controls.SetChildIndex(this.btnSave, 0);
            this.Controls.SetChildIndex(this.btnSaveNew, 0);
            this.Controls.SetChildIndex(this.btnCancel, 0);
            this.Controls.SetChildIndex(this.chxIsCurrent, 0);
            this.Controls.SetChildIndex(this.xtraTabControl1, 0);
            ((System.ComponentModel.ISupportInitialize)(this.Err)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.imageCollection2)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.chxIsCurrent.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.xtraTabControl1)).EndInit();
            this.xtraTabControl1.ResumeLayout(false);
            this.tabSides.ResumeLayout(false);
            this.grSideB.ResumeLayout(false);
            this.grSideB.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.txtIDCardPlace.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.dtIDCardDate.Properties.CalendarTimeProperties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.dtIDCardDate.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtIDCard.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtNationality1.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.glkEmployeeCode.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.gridLookUpEdit2View)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtEmployeeName.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtPosition.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtDepartment.Properties)).EndInit();
            this.grSideA.ResumeLayout(false);
            this.grSideA.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.txtTel.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtAddress.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtCompany.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtSignerNationality.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtSignerPosition.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.glkSignerCode.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.gridView1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtSigner.Properties)).EndInit();
            this.tabContractInformation.ResumeLayout(false);
            this.tabContractInformation.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.txtCreatePlace.Properties)).EndInit();
            this.grTerms.ResumeLayout(false);
            this.grTerms.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.calCompensation.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtWorkTime.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtPayDate.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtInsurance.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.cboPayForm.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.calBasicSalary.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtAllowance.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtContractName.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtContractCode.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtDescription.Properties)).EndInit();
            this.grContractInformation.ResumeLayout(false);
            this.grContractInformation.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.cboContractType.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.cboContractTime.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.dtFromDate.Properties.CalendarTimeProperties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.dtFromDate.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.dtToDate.Properties.CalendarTimeProperties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.dtToDate.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.dtSignDate.Properties.CalendarTimeProperties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.dtSignDate.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtSubject.Properties)).EndInit();
            this.ResumeLayout(false);

        }

        private void InitMultiLanguages()
        {
            this.tabSides.Text = MultiLanguages.GetString("tbl_ContractAdd", "tabSides", this.tabSides.Text);
            this.tabContractInformation.Text = MultiLanguages.GetString("tbl_ContractAdd", "tabContractInformation", this.tabContractInformation.Text);
            this.grSideA.Text = MultiLanguages.GetString("tbl_ContractAdd", "grSideA", this.grSideA.Text);
            this.grSideB.Text = MultiLanguages.GetString("tbl_ContractAdd", "grSideB", this.grSideB.Text);
            this.grContractInformation.Text = MultiLanguages.GetString("tbl_ContractAdd", "grContractInformation", this.grContractInformation.Text);
            this.grTerms.Text = MultiLanguages.GetString("tbl_ContractAdd", "grTerms", this.grTerms.Text);
            this.lcContractCode.Text = MultiLanguages.GetString("tbl_ContractAdd", "ContractCode", this.lcContractCode.Text);
            this.lcEmployeeCode.Text = MultiLanguages.GetString("tbl_ContractAdd", "EmployeeCode", this.lcEmployeeCode.Text);
            this.lcContractTime.Text = MultiLanguages.GetString("tbl_ContractAdd", "ContractTime", this.lcContractTime.Text);
            this.lcSignDate.Text = MultiLanguages.GetString("tbl_ContractAdd", "SignDate", this.lcSignDate.Text);
            this.lcFromDate.Text = MultiLanguages.GetString("tbl_ContractAdd", "FromDate", this.lcFromDate.Text);
            this.lcToDate.Text = MultiLanguages.GetString("tbl_ContractAdd", "ToDate", this.lcToDate.Text);
            this.lcSigner.Text = MultiLanguages.GetString("tbl_ContractAdd", "Signer", this.lcSigner.Text);
            this.lcSignerPosition.Text = MultiLanguages.GetString("tbl_ContractAdd", "SignerPosition", this.lcSignerPosition.Text);
            this.lcCompany.Text = MultiLanguages.GetString("tbl_ContractAdd", "Company", this.lcCompany.Text);
            this.lcAddress.Text = MultiLanguages.GetString("tbl_ContractAdd", "Address", this.lcAddress.Text);
            this.lcTel.Text = MultiLanguages.GetString("tbl_ContractAdd", "Tel", this.lcTel.Text);
            this.lcSubject.Text = MultiLanguages.GetString("tbl_ContractAdd", "Subject", this.lcSubject.Text);
            this.lcDescription.Text = MultiLanguages.GetString("tbl_ContractAdd", "Description", this.lcDescription.Text);
            this.chxIsCurrent.Text = MultiLanguages.GetString("tbl_ContractAdd", "IsCurrentContract", this.chxIsCurrent.Text);
            this.lcEmployeeCode.Text = MultiLanguages.GetString("tbl_ContractAdd", "EmployeeCode", this.lcEmployeeCode.Text);
            this.lcPosition.Text = MultiLanguages.GetString("tbl_ContractAdd", "Position", this.lcPosition.Text);
            this.lcDepartment.Text = MultiLanguages.GetString("tbl_ContractAdd", "Department", this.lcDepartment.Text);
            this.lcIDCard.Text = MultiLanguages.GetString("tbl_ContractAdd", "IDCard", this.lcIDCard.Text);
            this.lcIDCardDate.Text = MultiLanguages.GetString("tbl_ContractAdd", "IDCardDate", this.lcIDCardDate.Text);
            this.lcIDCardPlace.Text = MultiLanguages.GetString("tbl_ContractAdd", "IDCardPlace", this.lcIDCardPlace.Text);
            this.lcContractName.Text = MultiLanguages.GetString("tbl_ContractAdd", "ContractName", this.lcContractName.Text);
            this.lcContractType.Text = MultiLanguages.GetString("tbl_ContractAdd", "ContractType", this.lcContractType.Text);
            this.lcBasicSalary.Text = MultiLanguages.GetString("tbl_ContractAdd", "BasicSalary", this.lcBasicSalary.Text);
            this.lcPayForm.Text = MultiLanguages.GetString("tbl_ContractAdd", "PayForm", this.lcPayForm.Text);
            this.lcPayDate.Text = MultiLanguages.GetString("tbl_ContractAdd", "PayDate", this.lcPayDate.Text);
            this.lcAllowance.Text = MultiLanguages.GetString("tbl_ContractAdd", "Allowance", this.lcAllowance.Text);
            this.lcInsurance.Text = MultiLanguages.GetString("tbl_ContractAdd", "Insurance", this.lcInsurance.Text);
            this.lcWorkTime.Text = MultiLanguages.GetString("tbl_ContractAdd", "WorkTime", this.lcWorkTime.Text);
        }

        private void labelControl3_Click(object sender, EventArgs e)
        {
        }

        private void labelControl5_Click(object sender, EventArgs e)
        {
        }

        private void RaiseSuccessEventHander(HRM_CONTRACT item)
        {
            if (this.Success != null)
            {
                this.Success(this, item);
            }
        }

        public void SetData(HRM_CONTRACT item)
        {
            this.txtContractCode.Text = this.m_ContractCode = item.ContractCode;
            SYS_LOG.Insert("Hợp Đồng Lao Động", "Xem", this.txtContractCode.Text);
            if (base.m_Status == Actions.Update)
            {
                this.glkEmployeeCode.Properties.ReadOnly = true;
            }
            this.glkEmployeeCode.EditValue = item.EmployeeCode;
            this.cboContractType.SelectedIndex = item.ContractType;
            this.cboContractTime.Text = item.ContractTime;
            this.dtSignDate.DateTime = item.SignDate;
            this.dtFromDate.DateTime = item.FromDate;
            this.dtToDate.DateTime = item.ToDate;
            this.calBasicSalary.EditValue = item.BasicSalary;
            this.cboPayForm.Text = item.PayForm;
            this.txtPayDate.Text = item.PayDate;
            this.txtAllowance.Text = item.Allowance;
            this.txtInsurance.Text = item.Insurance;
            this.txtWorkTime.Text = item.WorkTime;
            this.calCompensation.EditValue = item.Compensation;
            this.txtSigner.Text = item.Signer;
            this.txtSignerPosition.Text = item.SignerPosition;
            this.txtSignerNationality.Text = item.SignerNationality;
            this.txtCompany.Text = item.Company;
            this.txtAddress.Text = item.Address;
            this.txtTel.Text = item.Tel;
            this.txtCreatePlace.Text = item.CreatePlace;
            this.txtSubject.Text = item.Subject;
            this.txtDescription.Text = item.Description;
            this.chxIsCurrent.Checked = true;
        }

        public void SetDefaultAdd(string EmployeeCode)
        {
            this.glkEmployeeCode.EditValue = EmployeeCode;
            this.glkEmployeeCode.Properties.ReadOnly = true;
        }

        private void txtID_EditValueChanged(object sender, EventArgs e)
        {
            TextEdit control = (TextEdit) sender;
            if (control.ErrorText != string.Empty)
            {
                base.Err.SetError(control, string.Empty);
            }
            if (this.txtContractCode.Text != this.m_ContractCode)
            {
                HRM_CONTRACT hrm_contract = new HRM_CONTRACT();
                if (hrm_contract.Exist(control.Text))
                {
                    base.Err.SetError(control, "M\x00e3 đ\x00e3 tồn tại.");
                    control.Focus();
                }
            }
        }

        private void txtID_KeyDown(object sender, KeyEventArgs e)
        {
            TextEdit control = (TextEdit) sender;
            if ((e.KeyCode == Keys.Enter) | (e.KeyCode == Keys.Tab))
            {
                HRM_CONTRACT hrm_contract = new HRM_CONTRACT();
                if ((base.m_Status == Actions.Add) && hrm_contract.Exist(control.Text))
                {
                    base.Err.SetError(control, "M\x00e3 đ\x00e3 tồn tại.");
                    control.Focus();
                }
            }
        }

        protected override string uc_Change()
        {
            return string.Empty;
        }

        protected override string uc_Delete()
        {
            HRM_CONTRACT item = new HRM_CONTRACT {
                ContractCode = this.txtContractCode.Text
            };
            string str = item.Delete();
            if (str == "OK")
            {
                this.RaiseSuccessEventHander(item);
            }
            return str;
        }

        protected override string uc_Save()
        {
            if (MyRule.Get(MyLogin.RoleId, "bbiContract") != "OK")
            {
                return "";
            }
            if (!MyRule.AllowAdd)
            {
                MyRule.Notify();
                return "";
            }
            if ((this.txtContractCode.ErrorText != string.Empty) || (this.glkEmployeeCode.ErrorText != string.Empty))
            {
                MessageBox.Show("M\x00e3 hợp đồng hoặc m\x00e3 nh\x00e2n vi\x00ean kh\x00f4ng được tr\x00f9ng!", "Cảnh B\x00e1o");
                return "";
            }
            SYS_LOG.Insert("Hợp Đồng Lao Động", "Th\x00eam", this.txtContractCode.Text);
            Cursor.Current = Cursors.WaitCursor;
            HRM_CONTRACT item = new HRM_CONTRACT();
            item = this.InitClass();
            if (item == null)
            {
                return "FALSE";
            }
            base.SetWaitDialogCaption("Đang lưu dữ liệu...");
            string text = item.Insert();
            if (text == "OK")
            {
                this.RaiseSuccessEventHander(item);
            }
            Cursor.Current = Cursors.Default;
            if (text != "OK")
            {
                XtraMessageBox.Show(text, "Cảnh B\x00e1o", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            else
            {
                HRM_EMPLOYEE hrm_employee = new HRM_EMPLOYEE();
                hrm_employee.Get(this.glkEmployeeCode.EditValue.ToString());
                new HRM_PROCESS_SALARY { 
                    SalaryID = Guid.NewGuid(), EmployeeCode = hrm_employee.EmployeeCode, OldPayForm = hrm_employee.PayForm, OldPayMoney = hrm_employee.PayMoney, OldRankSalary = hrm_employee.RankSalary, OldStepSalary = hrm_employee.StepSalary, OldCoefficientSalary = hrm_employee.CoefficientSalary, OldMinimumSalary = hrm_employee.MinimumSalary, OldBasicSalary = hrm_employee.BasicSalary, OldInsuranceSalary = hrm_employee.InsuranceSalary, NewPayForm = 1, NewPayMoney = decimal.Parse(this.calBasicSalary.EditValue.ToString()), NewRankSalary = hrm_employee.RankSalary, NewStepSalary = hrm_employee.StepSalary, NewCoefficientSalary = hrm_employee.CoefficientSalary, NewMinimumSalary = hrm_employee.MinimumSalary, 
                    NewBasicSalary = decimal.Parse(this.calBasicSalary.EditValue.ToString()), NewInsuranceSalary = decimal.Parse(this.calBasicSalary.EditValue.ToString()), Date = this.dtSignDate.DateTime, Reason = "K\x00fd mới hợp đồng lao động", Person = this.txtSigner.Text
                 }.Insert();
                hrm_employee.ContractCode = this.txtContractCode.Text;
                hrm_employee.ContractType = this.cboContractType.Text;
                hrm_employee.ContractSignDate = this.dtFromDate.DateTime;
                hrm_employee.ContractFromDate = this.dtFromDate.DateTime;
                hrm_employee.ContractToDate = this.dtToDate.DateTime;
                if (hrm_employee.PayForm == 1)
                {
                    hrm_employee.PayMoney = decimal.Parse(this.calBasicSalary.EditValue.ToString());
                    hrm_employee.BasicSalary = hrm_employee.PayMoney;
                    hrm_employee.InsuranceSalary = hrm_employee.PayMoney;
                    hrm_employee.DateSalary = this.dtSignDate.DateTime;
                }
                hrm_employee.Update();
            }
            this.DoHide();
            return text;
        }

        protected override string uc_Update()
        {
            if (MyRule.Get(MyLogin.RoleId, "bbiContract") != "OK")
            {
                return "";
            }
            if (!MyRule.AllowEdit)
            {
                MyRule.Notify();
                return "";
            }
            SYS_LOG.Insert("Hợp Đồng Lao Động", "Cập Nhật", this.txtContractCode.Text);
            base.SetWaitDialogCaption("Đang cập nhật dữ liệu...");
            HRM_CONTRACT item = new HRM_CONTRACT();
            item = this.InitClass();
            string text = item.Update();
            if (text == "OK")
            {
                this.RaiseSuccessEventHander(item);
            }
            if (text != "OK")
            {
                XtraMessageBox.Show(text, "Cảnh B\x00e1o", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            else
            {
                HRM_EMPLOYEE hrm_employee = new HRM_EMPLOYEE();
                hrm_employee.Get(this.glkEmployeeCode.EditValue.ToString());
                if (hrm_employee.ContractCode == this.txtContractCode.Text)
                {
                    hrm_employee.ContractCode = this.txtContractCode.Text;
                    hrm_employee.ContractType = this.cboContractType.Text;
                    hrm_employee.ContractSignDate = this.dtFromDate.DateTime;
                    hrm_employee.ContractFromDate = this.dtFromDate.DateTime;
                    hrm_employee.ContractToDate = this.dtToDate.DateTime;
                    if (hrm_employee.PayForm == 1)
                    {
                        hrm_employee.PayMoney = decimal.Parse(this.calBasicSalary.EditValue.ToString());
                        hrm_employee.BasicSalary = hrm_employee.PayMoney;
                        hrm_employee.InsuranceSalary = hrm_employee.PayMoney;
                        hrm_employee.DateSalary = this.dtSignDate.DateTime;
                    }
                    hrm_employee.Update();
                }
            }
            this.DoHide();
            return text;
        }

        public delegate void SuccessEventHander(object sender, HRM_CONTRACT item);
    }
}

